{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "41bd56a7-9699-4f86-a1c2-585f6288fa69",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.006201024813875724"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import sys\n",
    "import pyvista\n",
    "# pyvista.global_theme.jupyter_backend='pythreejs'\n",
    "# sys.path.insert(0,'/Users/alan/Desktop/github/ZapMeNot')\n",
    "sys.path.insert(0,'/mnt/hgfs/ZapMeNot/')\n",
    "from zap_me_not import model, source, shield, detector, material\n",
    "\n",
    "my_source = source.PointSource(0, 0, 0)\n",
    "my_source.add_photon(0.4,3.0E+4)\n",
    "tank_model = model.Model()\n",
    "tank_model.add_source(my_source)\n",
    "tank_model.add_detector(detector.Detector(10, 10, 10))\n",
    "tank_model.calculate_exposure()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "79169426-af63-47f4-962b-ccdfe2159a96",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "ERROR:root:Cannot create GLX context.  Aborting.\n",
      "libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
      "libGL error: failed to load driver: swrast\n",
      "\u001b[0m\u001b[31m2023-01-15 10:14:37.126 (   1.102s) [        7E37C440]vtkXOpenGLRenderWindow.:635    ERR| vtkXOpenGLRenderWindow (0x2fe3c70): Cannot create GLX context.  Aborting.\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "# pyvista.set_jupyter_backend('ipygany')\n",
    "tank_model.display()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "734ecd1a-9f6e-472e-a9db-b26b39a0b341",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
